/*
 * config.c
 *
 *  Created on: May 23, 2021
 *      Author: kirk_
 */

#include "config.h"
#include "ds3231.h"

#define ucHeapRamSize 16384

#if ucHeapRamSize
uint8_t ucHeapRam[ucHeapRamSize];
#endif
HeapRegion_t xHeapRegions[] = {
#if ucHeapRamSize
		{ (void*)ucHeapRam, ucHeapRamSize },
#endif
		{ (void*)0x24000000, 0x80000 },
		{ NULL, 0 }
};

#ifdef __GNUC__
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE* f)
#endif /* __GNUC__ */

PUTCHAR_PROTOTYPE
{
	HAL_UART_Transmit(&huart1, (uint8_t*)&ch, 1, 0x1FFFF);
	return ch;
}


KDL_TB6612_t Motor[4];
KDL_Encoder_t Encoder[4];
KDL_MPU6050_t MPU6050;
KDL_Servo_t Servo[4];
HCSR04_t HCSR04[3];

KD_FloatPID_t Velocity[4];
#if Mech_Wheel
KD_FloatPID_t PositionX;
KD_FloatPID_t PositionY;
#endif
#if 0
KD_FloatPID_t PositionL;
KD_FloatPID_t PositionR;
//KD_FloatPID_t Position;
#endif

KD_FloatPID_t PositionX;
KD_FloatPID_t Direction;

_calendar_part calendar;//声明时钟结构体

void print_team(void)
{
	get_time();
	printf("\r\n\r\n");
	PRINTF("[Team Name] No License;\r\n");
	PRINTF("[Team Number] 2;\r\n");
	PRINTF("[Team Member 1 ] 2018190604035 2429316Z Kefan Zheng;\r\n");
	PRINTF("[Team Member 2 ] 2018190504034 2429586L Runhan Liu;\r\n");
	PRINTF("[Team Member 3 ] 2018190504021 2429573X Tong Xie;\r\n");
	PRINTF("[Team Member 4 ] 2018190504028 2429580Z Hai Zhu;\r\n");
	PRINTF("[Team Member 5 ] 2018190504016 2429568F Yiheng Fu;\r\n");
	PRINTF("[Team Member 6 ] 2018190504010 2429563Z Xiangyu Zhao;\r\n");
	PRINTF("[Team Member 7 ] 2018190504009 2429562W Yuchen Wei;\r\n");
	PRINTF("[Team Member 8 ] 2018190604015 2429296F Anbo Feng;\r\n");
	PRINTF("[Team Member 9 ] 2018190604025 2429306Y Dingyao Yan;\r\n");
	PRINTF("[Team Member 10] 2018190604009 2429290L Zelin Li;\r\n");
	PRINTF("[Date] %lu.%u.%u %u.\r\n", calendar.year, calendar.month, calendar.day, calendar.week);
	PRINTF("[Time] %02u:%02u:%02u.\r\n", calendar.hour, calendar.min, calendar.sec);
	PRINTF("[Running] %lu ms.\r\n", HAL_GetTick());
}
